<?php
function activiteiten_tabel_for_mail($result)
{
	$output = "";
	$color = true;
	if($result <> null && mysql_num_rows($result) > 0) {
		$output .= "<table style='border-top: 3px solid #c1c1c1; border-bottom: 3px solid #c1c1c1;' cellspacing='0'>
			<tr style='height: 28px; line-height: 28px;".($color ? "" : " background-color: #f2f2f2;")."'>
				<th style='width: 88px; border-bottom: 2px double #c1c1c1; text-align: center;'>Dag</th>
				<th style='width: 98px; border-left: 1px dotted #CCC; border-bottom: 2px double #c1c1c1; text-align: center;'>Datum</th>
				<th style='width: 48px; border-left: 1px dotted #CCC; border-bottom: 2px double #c1c1c1; text-align: center;'>Tijd</th>
				<th style='width: 198px; border-left: 1px dotted #CCC; border-bottom: 2px double #c1c1c1; text-align: center;'>Activiteit</th>
			</tr>
		</thead>
		<tbody>";
		while($row = mysql_fetch_array($result)) {
			($color ? $color = false: $color = true);
			$output .= "<tr style='height: 28px; line-height: 28px;".($color ? "" : " background-color: #f2f2f2;")."'>";
				//Dag
				$output .= "<td style='text-align: center;'>";
	    			$output .= getDagWeekString(date('w', strtotime($row['datum'])), false)."</td>";
    			//Datum
    			$output .= "<td style='border-left: 1px dotted #CCC; text-align: center;'>";
	    			$output .= date('j', strtotime($row['datum']))." ".getMaandString(date('m', strtotime($row['datum'])), false)."</td>";
    			//Tijd
    			$output .= "<td style='border-left: 1px dotted #CCC; text-align: center;'>";
	    			$output .= date('H:i', strtotime($row['datum']))."</td>";
    			//Activiteit
    			$output .= "<td style='border-left: 1px dotted #CCC; text-align: center;'>";
	    			$output .= $row['gebeurtenis']."</td>";
    		$output .= "</tr>";
		}
		$output .= "</table>";
	}
	return $output;
}
?>